<?php
 /**
* @package   auto_occasion
* @subpackage commun
* @author    CMS
* @copyright 2012
* @license    All rights reserved
*/

/**
 * Classe pour une tache cron  : importation des partenaires
 */
class cronImportPartenaireCtrl extends jControllerCmdLine {
 
    function index() {
        if ( array_key_exists('REMOTE_ADDR', $_SERVER) )
            die("Can only be run from the command line!");

        $rep = $this->getResponse(); // cmdline response by default
        try {
            exec('bash /var/www/html/projets/auto_occasion/scripts/awk/import/traitement_speedimpact.sh');
            echo 'OK - Partener imported at ' . date("Y-m-d h:i:s");
        } catch (exception $e) {
            echo $e->getMessage();
        }

        return $rep;

    }

}